#include <bits/stdc++.h>
using namespace std;
int n;
int r[100005],st[100005];
struct q{
    int pwr;
    int num;
};
vector<q> mtr;
int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin >> n;
    for(int i=1; i<=n; i++)
    {
        cin >> r[i];
        st[r[i]]++;
    }
    for(int i=1; i<=100000; i++)
        if(st[i])
            mtr.push_back({i,st[i]});
    int ans=0;
    for(int i=0; i<mtr.size(); i++)
    {
        int destroyer=mtr[i+1].num;
        int preventer=mtr[i].num;
        ans+=min(preventer,destroyer);
        mtr[i+1].num+=max(preventer-destroyer,0);
    }
    cout << n-ans;
    return 0;
}
